<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <h:panelGroup rendered="true" >
            <h:form>
                <p:panel id="reportPrint" styleClass="noBorder summeryBorder" header="Casheir Session Report Detail">

                    <f:facet name="header" >

                        <h:outputLabel value="Day-End Detailed Report"/>

                        <h:outputLabel value="#{labels.company_name}"/> <br/>
                        <h:panelGrid columns="2" styleClass="noPrintButton" >
                            <h:outputLabel value="From Date"/>
                            <p:calendar id="frmDate" value="#{commonReport.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>

                            <h:outputLabel value="To Date"/>
                            <p:calendar id="toDate" value="#{commonReport.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>
                        </h:panelGrid>
                        <h:panelGrid columns="5" styleClass="noPrintButton" >
                            <p:spacer width="65" height="1"/>
                            <p:commandButton id="btnRefresh" ajax="false" value="Refresh" styleClass="noPrintButton" actionListener="#{commonReport.recreteModal()}" />  
                            <p:defaultCommand target="btnRefresh"/>

                            <p:commandButton ajax="false" value="Print" styleClass="noPrintButton" >
                                <p:printer target="reportPrint"/>
                            </p:commandButton>  
                            <p:commandButton ajax="false" value="Excel"  styleClass="noPrintButton"  >
                                <pe:exporter type="xlsx" 
                                             target="#{commonReport.institutionBilledBillsOwn.bills.size() ne 0 ?'billed,':''}
                                             #{commonReport.institutionCancelledBillsOwn.bills.size() ne 0 ?'cancelled,':''}
                                             #{commonReport.institutionRefundedBillsOwn.bills.size() ne 0 ?'refund,':''}
                                             #{commonReport.institutionBilledBillsOwnPh.bills.size() ne 0 ?'billedPh,':''}
                                             #{commonReport.institutionCancelledBillsOwnPh.bills.size() ne 0 ?'cancelledPh,':''}
                                             #{commonReport.institutionRefundedBillsOwnPh.bills.size() ne 0 ?'refundPh,':''}
                                             #{commonReport.institutionPaymentBillsOwn.bills.size() ne 0 ?'payment,':''}
                                             #{commonReport.institutionPaymentCancelBillsOwn.bills.size() ne 0 ?'paymentCancel,':''}
                                             #{commonReport.institutionPettyPaymentBillsOwn.bills.size() ne 0 ?'petty,':''}
                                             #{commonReport.institutionPettyCancellBillsOwn.bills.size() ne 0 ?'pettyCancel,':''}
                                             #{commonReport.institutionCashRecieveBillsOwn.bills.size() ne 0 ?'companyPay,':''}
                                             #{commonReport.institutionCashRecieveCancellBillsOwn.bills.size() ne 0 ?'companyCancel,':''}
                                             #{commonReport.institutionAgentBillsOwn.bills.size() ne 0 ?'agent,':''}
                                             #{commonReport.institutionAgentCancellBillsOwn.bills.size() ne 0 ?'agentCancel,':''}
                                             #{commonReport.institutionInwardPaymentBillsOwn.bills.size() ne 0 ?'inward,':''}
                                             #{commonReport.institutionInwardPaymentCancelBillsOwn.bills.size() ne 0 ?'inwardCancel,':''}
                                             sum"  fileName="Cashier_Detailed_Reports" />
                            </p:commandButton> 
                            </h:panelGrid>
                       
                            <h:panelGrid columns="7" styleClass="printBlock" style="min-width: 100%;">
                                <h:outputLabel value="Cashier Day End Detailed Report "/>
                                <p:spacer width="20" height="0"/>
                                <h:outputLabel value="From" />
                                <h:outputLabel  value="#{cashierReportController.fromDate}" >
                                    <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                                </h:outputLabel>
                                <p:spacer width="10" height="0"/>
                                <h:outputLabel value="To"/>
                                <h:outputLabel  value="#{cashierReportController.toDate}" style="float: right" >
                                    <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                                </h:outputLabel>
                            </h:panelGrid>
                    </f:facet>
                    <p:dataTable id="billed"  value="#{commonReport.institutionBilledBillsOwn.bills}" var="b" 
                                 rendered="#{commonReport.institutionBilledBillsOwn.bills.size()>0}" sortBy="#{b.billType}"  
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">

                        <f:facet name="header">
                            <h:outputLabel value="Day-End Detailed Report"/>
                            <h:outputLabel value="Opd Bills"/>
                        </f:facet>

                        <p:column headerText="Time"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="h:mm a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier" >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>
                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>

                        <p:column headerText="To Department"  >
                            <f:facet name="header">  
                                <h:outputLabel value="To Department"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.toDepartment.name}"/>

                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value=" #{b.patient.person.nameWithTitle}"/>               
                        </p:column>

                        <p:column headerText="Dis." style=" text-align: right">
                            <f:facet name="header">  
                                <h:outputLabel value="Dis."/>
                            </f:facet> 
                            <h:outputLabel value="#{b.discount}">
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="C Card" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Card'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cheque'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Slip'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Remark" >
                            <f:facet name="header">  
                                <h:outputLabel value="Remark"/>
                            </f:facet> 
                            <h:outputLabel value="Cancelled. (#{b.cancelledBill.insId})" rendered="#{b.cancelled==true}" ></h:outputLabel>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row >  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>

                                <p:column footerText="#{commonReport.institutionBilledBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column footerText="#{commonReport.institutionBilledBillsOwn.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwn.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  


                                <p:column footerText="#{commonReport.institutionBilledBillsOwn.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwn.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  

                                <p:column footerText="#{commonReport.institutionBilledBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column> 

                                <p:column footerText="#{commonReport.institutionBilledBillsOwn.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="cancelled"  value="#{commonReport.institutionCancelledBillsOwn.bills}" var="b1"  
                                 rendered="#{commonReport.institutionCancelledBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Cancelled"/>
                        </f:facet> 
                        <p:column headerText="Time"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.creater.webUserPerson.name}"/>

                        </p:column>
                        <p:column headerText="Cancelled Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.insId}"/>
                        </p:column>

                        <p:column headerText="Billed Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.patient.person.nameWithTitle}"/>

                        </p:column>
                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.comments}"/>

                        </p:column>

                        <p:column headerText="Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>
                        <p:column headerText="C Card"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Card'}" value="#{b1.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cheque'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Slip'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  

                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:">

                                </p:column>
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwn.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwn.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>                   
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwn.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwn.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column> 
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwn.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>                                                                 
                            </p:row>  

                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="refund" value="#{commonReport.institutionRefundedBillsOwn.bills}" var="b" sortBy="#{b.billType}"  
                                 rendered="#{commonReport.institutionRefundedBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Refunded" />
                        </f:facet> 
                        <p:column headerText="Time"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Refunded Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Refunded Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.insId}" ></h:outputLabel>
                        </p:column>

                        <p:column headerText="Billed Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.patient.person.nameWithTitle}" >
                            </h:outputLabel>

                        </p:column>
                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.comments}" ></h:outputLabel>
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="C Card" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Card'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cheque'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Slip'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwn.cash}">  
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwn.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwn.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwn.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwn.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwn.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="billedPh"  value="#{commonReport.institutionBilledBillsOwnPh.bills}" var="b"
                                 rendered="#{commonReport.institutionBilledBillsOwnPh.bills.size()>0}" sortBy="#{b.billType}"  
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">

                        <f:facet name="header">  
                            <h:outputLabel value="Opd Bills "/>
                        </f:facet>

                        <p:column headerText="Time"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="h:mm a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>
                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>

                        <p:column headerText="To Department"  >
                            <f:facet name="header">  
                                <h:outputLabel value="To Department"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.toDepartment.name}"/>

                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value=" #{b.patient.person.nameWithTitle}"/>               
                        </p:column>

                        <p:column headerText="Dis." style=" text-align: right">
                            <f:facet name="header">  
                                <h:outputLabel value="Dis."/>
                            </f:facet> 
                            <h:outputLabel value="#{b.discount}">
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="C Card" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Card'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cheque'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Slip'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Remark" >
                            <f:facet name="header">  
                                <h:outputLabel value="Remark"/>
                            </f:facet> 
                            <h:outputLabel value="Cancelled. (#{b.cancelledBill.insId})" rendered="#{b.cancelled==true}" ></h:outputLabel>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row >  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>

                                <p:column footerText="#{commonReport.institutionBilledBillsOwnPh.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwnPh.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column footerText="#{commonReport.institutionBilledBillsOwnPh.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwnPh.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  


                                <p:column footerText="#{commonReport.institutionBilledBillsOwnPh.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwnPh.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  

                                <p:column footerText="#{commonReport.institutionBilledBillsOwnPh.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwnPh.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column> 

                                <p:column footerText="#{commonReport.institutionBilledBillsOwnPh.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionBilledBillsOwnPh.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="cancelledPh"  value="#{commonReport.institutionCancelledBillsOwnPh.bills}" var="b1"  
                                 rendered="#{commonReport.institutionCancelledBillsOwnPh.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Cancelled"/>
                        </f:facet> 
                        <p:column headerText="Time"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.creater.webUserPerson.name}"/>

                        </p:column>
                        <p:column headerText="Cancelled Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.insId}"/>
                        </p:column>

                        <p:column headerText="Billed Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.patient.person.nameWithTitle}"/>

                        </p:column>
                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.comments}"/>

                        </p:column>

                        <p:column headerText="Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>
                        <p:column headerText="C Card"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Card'}" value="#{b1.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cheque'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Slip'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  

                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:">

                                </p:column>
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwnPh.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwnPh.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwnPh.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwnPh.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>                   
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwnPh.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwnPh.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>  
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwnPh.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwnPh.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column> 
                                <p:column footerText="#{commonReport.institutionCancelledBillsOwnPh.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCancelledBillsOwnPh.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>                                                                 
                            </p:row>  

                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="refundPh" value="#{commonReport.institutionRefundedBillsOwnPh.bills}" var="b" sortBy="#{b.billType}"
                                 rendered="#{commonReport.institutionRefundedBillsOwnPh.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Refunded" />
                        </f:facet> 
                        <p:column headerText="Time"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Refunded Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Refunded Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.insId}" ></h:outputLabel>
                        </p:column>

                        <p:column headerText="Billed Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Patient Name" >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.patient.person.nameWithTitle}" >
                            </h:outputLabel>

                        </p:column>
                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.comments}" ></h:outputLabel>
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="C Card" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="C Card"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Card'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Card'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Checque" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cheque'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>

                        <p:column headerText="Slip" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Slip'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwnPh.cash}">  
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwnPh.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwnPh.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwnPh.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwnPh.card}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwnPh.card}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwnPh.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwnPh.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionRefundedBillsOwnPh.slip}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionRefundedBillsOwnPh.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="payment" value="#{commonReport.institutionPaymentBillsOwn.bills}" var="b"   sortBy="#{b.billType}" 
                                 rendered="#{commonReport.institutionPaymentBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Payments"/>
                        </f:facet> 
                        <p:column headerText="Time" rendered="#{commonReport.fromDate ne commonReport.toDate}"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}"  >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>      
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>
                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>
                        <p:column headerText="Paid to"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Paid to"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.staff.person.nameWithTitle}"/>
                        </p:column>
                        <p:column headerText="Cash" style=" text-align: right" rendered="#{commonReport.institutionPaymentBillsOwn.cash!=0.0}"  >
                            <f:facet name="footer">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionPaymentBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPaymentBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="paymentCancel" value="#{commonReport.institutionPaymentCancelBillsOwn.bills}" var="b"   
                                 sortBy="#{b.billType}" 
                                 rendered="#{commonReport.institutionPaymentCancelBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="PaymentsCancel" />
                        </f:facet> 
                        <p:column headerText="Time" rendered="#{commonReport.fromDate ne commonReport.toDate}"  >
                            <f:facet name="header">  
                                <h:outputLabel value="PaymentsCancel" />
                            </f:facet>
                            <h:outputLabel value="#{b.createdAt}"  >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id" />
                            </f:facet>
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>

                        <p:column headerText="For Wich Staff"  >
                            <f:facet name="header">  
                                <h:outputLabel value="For Wich Staff" />
                            </f:facet>
                            <h:outputLabel value="#{b.staff.person.nameWithTitle}"/>

                        </p:column>

                        <p:column headerText="Comment"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment" />
                            </f:facet>
                            <h:outputLabel value="#{b.comments}"/>                           
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right" rendered="#{commonReport.institutionPaymentCancelBillsOwn.cash!=0.0}"  >
                            <f:facet name="footer">  
                                <h:outputLabel value="Cash" />
                            </f:facet>
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="5" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionPaymentCancelBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPaymentCancelBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="petty" value="#{commonReport.institutionPettyPaymentBillsOwn.bills}" var="b4"   
                                 sortBy="#{b4.billType}" 
                                 rendered="#{commonReport.institutionPettyPaymentBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Petty Cash Payment"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; " >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 

                            <h:outputLabel value=" #{b4.insId}"/>
                        </p:column>

                        <p:column headerText="For Whome"  >
                            <f:facet name="header">  
                                <h:outputLabel value="For Whome"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.staff.person.nameWithTitle}" rendered="#{b4.person eq null}"/>
                            <h:outputLabel value="#{b4.person.nameWithTitle}" rendered="#{b4.person ne null}"/>
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b4.paymentMethod=='Cash'}" value="#{b4.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b4.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="footer">  
                                <h:outputLabel value="Checque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b4.paymentMethod=='Cheque'}" value="#{b4.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b4.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Descripion"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet> 

                            <h:outputLabel value="#{b4.comments}"/>
                        </p:column>
                        <p:column headerText="Invoice" >
                            <f:facet name="header">  
                                <h:outputLabel value="Invoice"/>
                            </f:facet> 

                            <h:outputLabel value="#{b4.invoiceNumber}"/>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionPettyPaymentBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPettyPaymentBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionPettyPaymentBillsOwn.cheque}"> 
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPettyPaymentBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>


                    <p:dataTable id="pettyCancel" value="#{commonReport.institutionPettyCancellBillsOwn.bills}" var="b4"   
                                 sortBy="#{b4.billType}" rendered="#{commonReport.institutionPettyCancellBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel  value="Petty Cash Payment Cancel"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; " >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>

                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>
                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.insId}"/>
                        </p:column>

                        <p:column headerText="For Whome" >
                            <f:facet name="header">  
                                <h:outputLabel value="For Whome"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.staff.person.nameWithTitle}" rendered="#{b4.person eq null}"/>
                            <h:outputLabel value="#{b4.person.nameWithTitle}" rendered="#{b4.person ne null}"/>
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b4.paymentMethod=='Cash'}" value="#{b4.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b4.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cheque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b4.paymentMethod=='Cheque'}" value="#{b4.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b4.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Descripion" >
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.comments}"/>
                        </p:column>
                        <p:column headerText="Billed Id"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Billed Date/Time"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Date/Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b4.billedBill.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>
                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionPettyCancellBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPettyCancellBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionPettyCancellBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionPettyCancellBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="companyPay" value="#{commonReport.institutionCashRecieveBillsOwn.bills}" var="b7"   
                                 sortBy="#{b7.billType}" rendered="#{commonReport.institutionCashRecieveBillsOwn.bills.size()>0}"

                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Credit Company Payment Recieve"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; ">
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.insId}" />
                        </p:column>
                        <p:column headerText="Credit Company"  > 
                            <f:facet name="header">  
                                <h:outputLabel value="Credit Company"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.fromInstitution.name}" />
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cash'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cheque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cheque'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column> 
                        <p:column headerText="Slip" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Slip'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column> 
                        <p:column headerText="Descripion" >
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.comments}" />
                        </p:column>                                               

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionCashRecieveBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionCashRecieveBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionCashRecieveBillsOwn.slip}"> 
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>


                    <p:dataTable id="companyCancel" value="#{commonReport.institutionCashRecieveCancellBillsOwn.bills}" var="b7"  
                                 sortBy="#{b7.billType}" rendered="#{commonReport.institutionCashRecieveCancellBillsOwn.bills.size()>0}"

                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Credit Company Payment Cancel"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; " >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.insId}"/>
                        </p:column>
                        <p:column headerText="Credit Company"  >   
                            <f:facet name="header">  
                                <h:outputLabel value="Credit Company"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.fromInstitution.name}" />
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cash'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>   

                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cheque"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cheque'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>    

                        <p:column headerText="Slip" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b7.paymentMethod=='Slip'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>    

                        <p:column headerText="Descripion"  style="">
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.comments}" />
                        </p:column>    
                        <p:column headerText="Billed Id" style="" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Billed Date/Time" style="" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Date/Time"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.billedBill.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/> 
                                <p:column footerText="#{commonReport.institutionCashRecieveCancellBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveCancellBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionCashRecieveCancellBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveCancellBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionCashRecieveCancellBillsOwn.slip}"> 
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionCashRecieveCancellBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup>
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="agent" value="#{commonReport.institutionAgentBillsOwn.bills}" var="b7"   sortBy="#{b7.billType}" 
                                 rendered="#{commonReport.institutionAgentBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Agent Payment Recieve"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; ">
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id"  style="">
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.insId}"/>
                        </p:column>
                        <p:column headerText="Agent"  style="">      
                            <f:facet name="header">  
                                <h:outputLabel value="Agent"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.fromInstitution.name}" />
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cash'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>    
                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cheque"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cheque'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column>  
                        <p:column headerText="Slip" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Slip'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column>  
                        <p:column headerText="Descripion"  style="">
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.comments}" />
                        </p:column>                                               

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionAgentBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionAgentBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionAgentBillsOwn.slip}"> 
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>  
                        </p:columnGroup> 

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="agentCancel"  value="#{commonReport.institutionAgentCancellBillsOwn.bills}" var="b7"   
                                 sortBy="#{b7.billType}" rendered="#{commonReport.institutionAgentCancellBillsOwn.bills.size()>0}"

                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Agent Payment Cancel"/>
                        </f:facet> 
                        <p:column headerText="Time" style="width:16%; " >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.createdAt}" >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b7.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id"  style="">
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.insId}"/>
                        </p:column>
                        <p:column headerText="Agent"  style=""> 
                            <f:facet name="header">  
                                <h:outputLabel value="Agent"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.fromInstitution.name}" />
                        </p:column>

                        <p:column headerText="Cash" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cash'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>    

                        <p:column headerText="Cheque" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cheque"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Cheque'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Cheque'}" value="0.00"/>
                        </p:column> 

                        <p:column headerText="Slip" style="text-align: right;"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Slip"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b7.paymentMethod=='Slip'}" value="#{b7.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b7.paymentMethod!='Slip'}" value="0.00"/>
                        </p:column> 

                        <p:column headerText="Descripion"  style="">
                            <f:facet name="header">  
                                <h:outputLabel value="Descripion"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.comments}"/>
                        </p:column>    
                        <p:column headerText="Billed Id" style="" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Id"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.billedBill.insId}" >
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Billed Date/Time" style="" >
                            <f:facet name="header">  
                                <h:outputLabel value="Billed Date/Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b7.billedBill.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>
                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>  
                                <p:column footerText="#{commonReport.institutionAgentCancellBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentCancellBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionAgentCancellBillsOwn.cheque}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentCancellBillsOwn.cheque}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                <p:column footerText="#{commonReport.institutionAgentCancellBillsOwn.slip}"> 
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionAgentCancellBillsOwn.slip}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>                   
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="inward" value="#{commonReport.institutionInwardPaymentBillsOwn.bills}" var="b"   
                                 sortBy="#{b.billType}" rendered="#{commonReport.institutionInwardPaymentBillsOwn.bills.size()>0}" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Inward Payments" />
                        </f:facet> 
                        <p:column headerText="Time" rendered="#{commonReport.fromDate ne commonReport.toDate}"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b.createdAt}"  >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>     
                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>
                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>
                        <p:column headerText="Bht No"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel  value="#{b.patientEncounter.bhtNo}"/>
                        </p:column>
                        <p:column headerText="Patient"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b.patient.person.nameWithTitle}"/>
                        </p:column>
                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>   
                                <p:column footerText="#{commonReport.institutionInwardPaymentBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionInwardPaymentBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>                   
                        </p:columnGroup> 
                    </p:dataTable>


                    <p:spacer height="30"/>

                    <p:dataTable id="inwardCancel" value="#{commonReport.institutionInwardPaymentCancelBillsOwn.bills}" var="b"  
                                 sortBy="#{b.billType}" rendered="#{commonReport.institutionInwardPaymentCancelBillsOwn.bills.size()>0}"

                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">  
                            <h:outputLabel value="Inward Payments Cancel"/>
                        </f:facet> 
                        <p:column headerText="Time" rendered="#{commonReport.fromDate ne commonReport.toDate}"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel value="#{b.createdAt}"  >
                                <f:convertDateTime pattern="HH:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Cashier"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cashier"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.creater.webUserPerson.name}"/>

                        </p:column>

                        <p:column headerText="Id" >
                            <f:facet name="header">  
                                <h:outputLabel value="Id"/>
                            </f:facet>
                            <h:outputLabel value="#{b.insId}"/>
                        </p:column>

                        <p:column headerText="Bht No"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Bht No"/>
                            </f:facet>
                            <h:outputLabel value="#{b.patientEncounter.bhtNo}"/>
                        </p:column>
                        <p:column headerText="Patient"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Patient"/>
                            </f:facet>
                            <h:outputLabel value="#{b.patient.person.nameWithTitle}"/>
                        </p:column>
                        <p:column headerText="Comment"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet>
                            <h:outputLabel value="#{b.comments}"/>
                        </p:column>

                        <p:column headerText="Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Time"/>
                            </f:facet>
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row>  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>                                  

                                <p:column footerText="#{commonReport.institutionInwardPaymentCancelBillsOwn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.institutionInwardPaymentCancelBillsOwn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>                   
                        </p:columnGroup> 
                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="sum" value="#{commonReport.dataTableData}"  var="i" 
                                 paginator="false"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15,20">
                        <f:facet name="header">
                            Summary
                        </f:facet>
                        <p:column>
                            <h:outputLabel value="#{i.string}"/>
                        </p:column>
                        <p:column style="font-weight: bold;text-align:right;" >
                            <h:outputLabel value="#{i.value}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </p:column>
                <f:facet name="footer" >
                    <h:outputLabel value="Printed By : #{sessionController.loggedUser.webUserPerson.name}" style="float: right"/>
                </f:facet>
                    </p:dataTable>


                </p:panel>
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
